Repository navigation
feat(id): provisioning surface producing the #3403 gate's evidence - #13162
Conversation
The gate in provisioning.ts is a pure validator: it consumes deployed-account evidence and never probes an account itself. This adds the prober it presupposes, in pkgs/id/hosted-worker: - src/provisioning-surface.ts: R2 buckets are provisioned only through the Cloudflare API route with the cf-r2-jurisdiction header (the #2285 canary showed wrangler's --jurisdiction flag can be silently ignored); a bucket's jurisdiction is taken only from the API read-back, probing each supported jurisdiction with its header because a jurisdiction-less read cannot see scoped buckets; canary results are captured into the gate's evidence shape verbatim; provisionAndValidate invokes the gate before any production signup/migration enablement and returns its plan or its refusal. No deployment is authorized and no residency claim is made. - test/provisioning-surface.test.ts: 14 tests against a fake client modelling the canary's observed API behaviour, including the create-409/read-back mismatch path and the no-create rule under an unsupported jurisdiction. - package.json: the new test file joins the package test script. Full hosted-worker suite: 116 passed / 0 failed; tsc --noEmit clean.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 41 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ab86cf50ca
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Provisioning surface for hosted production enablement (#3403): the | ||
| // evidence-producing half of the provisioning gate in | ||
| // ./provisioning.ts. The gate is a pure validator — it consumes | ||
| // deployed-account evidence and never probes an account itself. This | ||
| // module is the prober it presupposes: |
There was a problem hiding this comment.
Add the required design record for the provisioning surface
This change introduces an account-mutating provisioning API and non-obvious evidence decisions, including inferring jurisdiction from a scoped GET when the response omits it, but the commit contains only implementation and tests. The applicable pkgs/id/AGENTS.md requires a dated design document for new behavior, interface changes, and design trade-offs. Add that record describing the provisioning contract, evidence assumptions, and failure behavior; the source comments and commit message do not satisfy the required documentation artifact.
AGENTS.md reference: pkgs/id/AGENTS.md:L159-L168
Useful? React with 👍 / 👎.
The provisioning/deployment surface for #3403 — the slice Lane HP's gate record and the code-g park note both name as the remainder after PR #12985 landed the validator.
src/provisioning.tsis a pure validator: it consumes deployed-account evidence and never probes an account itself. This PR adds the prober it presupposes,src/provisioning-surface.ts:cf-r2-jurisdictionheader (the id: PoC: verify DO jurisdiction mechanics and confirm vendor residency guarantees #2285 canary showed wrangler's--jurisdictionflag can be silently ignored, creating a default bucket with no warning). Creation is idempotent: a 409 falls through to the read-back.default, never as the configured claim.unverified, and results for unsupported jurisdictions are dropped. This surface never upgrades a result — the gate judges it.provisionAndValidateprovisions the configured bucket, gathers the evidence, and returns the gate's validated plan or itsFailClosedrefusal. Under an unsupported jurisdiction it creates nothing. Nothing here authorizes a deployment or makes a residency claim.Tests:
test/provisioning-surface.test.ts(14 tests) runs against a fake client modelling the canary's observed API behaviour, including the create-409/read-back mismatch path and the client header contract. Full hosted-worker suite on the laptop: 116 passed / 0 failed;tsc --noEmitclean. A remote dispatch of the two provisioning test files was attempted (run 45147697038); the fleet-build container has no Node.js (node: command not found, exit 127), so that leg is environmental, not a test result.#3403 stays open: the remaining step is running this surface against the real account (the live canary/deployment evidence run), which is a production action outside this slice.